package com.noreply.springannotation.filter;

import org.springframework.core.io.Resource;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;

import java.io.IOException;

/**
 * @author noreply
 * @description
 * @datetime 2022/3/11 9:24
 */
public class CustomFilter implements TypeFilter {


    @Override
    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
        System.out.println(metadataReader.toString());
        System.out.println(metadataReaderFactory.toString());
        // metadataReader 就4个get方法
        AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
        ClassMetadata classMetadata = metadataReader.getClassMetadata();
        Class<? extends MetadataReader> aClass = metadataReader.getClass();
        Resource resource = metadataReader.getResource();
        return false;
    }
}
